package com.psp.web.service;

import java.io.IOException;
import java.io.OutputStream;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.psp.web.controller.res.bean.RConfirmOrderProductBean;
import com.psp.web.controller.res.bean.ROrderDetailBean;
import com.psp.web.controller.res.bean.ROrderListBean;
import com.psp.web.model.OrderBean;
import com.psp.web.service.exception.ServiceException;
import com.psp.web.service.impl.PageResult;

public interface OrderService {

	/**
	 * 获取订单详情
	 * 
	 * @param oid
	 *            订单id
	 * @return
	 */
	ROrderDetailBean getDetail(String uid, String oid) throws ServiceException;

	/**
	 * 确认订单
	 * 
	 * @param uid
	 *            用户id
	 * @param pid
	 *            服务id
	 * @param skuCode
	 *            服务skuCode
	 * @param addressAid
	 *            收货人地址id
	 * @param invoiceHeaderId
	 *            发票头信息id
	 * @param invoiceAid
	 *            发票邮寄地址id
	 * @return
	 * @throws ServiceException
	 */
	OrderBean confirmOrder(String uid, String pid, String skuCode, String addressAid, String invoiceHeaderId,
			String invoiceAid) throws ServiceException;

	/**
	 * 获取确认订单中的服务信息
	 * 
	 * @param uid
	 * @param pid
	 * @param skuCode
	 * @return
	 */
	RConfirmOrderProductBean getOrderProduct(String uid, String pid, String skuCode) throws ServiceException;

	/**
	 * 订单列表
	 * 
	 * @param page
	 *            当前请求页，从0开始
	 * @param pageSize
	 *            当前请求页的大小 10
	 * @param uid
	 *            用户id
	 * @param orderNo
	 *            订单编号
	 * @param s
	 *            订单状态
	 * @return
	 */
	PageResult<ROrderListBean> getList(int page, int pageSize, String uid, String orderNo, int[] s)
			throws ServiceException;
	
	/**
	 * 获取微信支付二维码
	 * @param uid
	 * @param pid
	 * @param attach
	 * @param body
	 * @param detail
	 * @param totalFee
	 * @param width 
	 * @param oid 
	 * @param response 
	 * @return
	 * @throws Exception 
	 */
	void getWechatQRCode(String uid, String pid, String attach, String body, String detail, Integer totalFee, OutputStream os, Integer width, String ip, String oid) throws Exception;

	boolean updatePayedOrder(HttpServletRequest request, HttpServletResponse response) throws IOException;

}
